package com.lucky.contract;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@MapperScan("com.lucky.contract.dao")
@EnableTransactionManagement
@EnableScheduling
public class ContractApplication extends SpringBootServletInitializer {
    private static final Logger log = LoggerFactory.getLogger(ContractApplication.class);
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        builder.sources(this.getClass());
        ApplicationContext context = builder.run(new String[]{});
        return builder.sources(ContractApplication.class);
    }

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(ContractApplication.class, args);
        //SpringApplication.run(ContractApplication.class, args);
        log.info("项目开始了！！！！");
    }
}

